<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04-json的对象.html</title>
</head>
<body>

<!--
    1、json  的定义 和 获取 json对象中属性
        {键值对集合}
    2、json 对象转成字符串
    3、json 字符串 转成 json对象
  -->
<script>
    var jsonObj = {name:"zs", age:20}
    console.log(jsonObj.name)
    console.log(jsonObj.age)
    var arr = [
      {
        name:"lisi",
        age:20
      },
      {
        name:"wangwu ",
        age:30
      }
    ]

    console.log(arr[0].name)
    console.log(arr[1].name)

    var stus = [
      {
        name: '乔峰',
        age: 20
      },
      {
        name: 'yuanjie',
        age: 26,
        address:[
          {province: 'gd', city: 'gz'},
          {province: 'gd', city: 'sz'},
        ]
      }
    ]
    console.log(stus[1].address)
    console.log(stus[1].address[0].province)
    console.log(stus[1].address[0].city)

    console.log(stus[1].address[1].province)
    console.log(stus[1].address[1].city)

</script>

</body>
</html>